package cn.dsscm.dao;

import cn.dsscm.pojo.Product;
import org.apache.ibatis.annotations.Param;
import java.util.List;

public interface ProductMapper {
    Product getProductById(@Param("id") Integer id);
    int add(Product product);
    List<Product> getProductList(
            @Param("name") String name,
            @Param("categoryLevel1Id") Integer categoryLevel1Id,
            @Param("categoryLevel2Id") Integer categoryLevel2Id,
            @Param("categoryLevel3Id") Integer categoryLevel3Id,
            @Param("offset") Integer offset,
            @Param("pageSize") Integer pageSize);
    int getProductCount(
            @Param("name") String name,
            @Param("categoryLevel1Id") Integer categoryLevel1Id,
            @Param("categoryLevel2Id") Integer categoryLevel2Id,
            @Param("categoryLevel3Id") Integer categoryLevel3Id);
    int deleteProductById(@Param("id") Integer delId);
    int modify(Product product);
    int productNameIsExist(@Param("name") String name);
}